package com.ruoyi.service.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.service.mapper.ServiceContractMapper;
import com.ruoyi.service.domain.ServiceContract;
import com.ruoyi.service.service.IServiceContractService;

/**
 * 维保合同Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-06
 */
@Service
public class ServiceContractServiceImpl implements IServiceContractService 
{
    private static final Logger log = LoggerFactory.getLogger(ServiceContractServiceImpl.class);

    @Autowired
    private ServiceContractMapper serviceContractMapper;

    /**
     * 查询维保合同
     * 
     * @param id 维保合同主键
     * @return 维保合同
     */
    @Override
    public ServiceContract selectServiceContractById(Long id)
    {
        return serviceContractMapper.selectServiceContractById(id);
    }

    /**
     * 查询维保合同列表
     * 
     * @param serviceContract 维保合同
     * @return 维保合同
     */
    @Override
    public List<ServiceContract> selectServiceContractList(ServiceContract serviceContract)
    {
        return serviceContractMapper.selectServiceContractList(serviceContract);
    }

    /**
     * 新增维保合同
     * 
     * @param serviceContract 维保合同
     * @return 结果
     */
    @Override
    public int insertServiceContract(ServiceContract serviceContract)
    {
        serviceContract.setCreateTime(DateUtils.getNowDate());
        return serviceContractMapper.insertServiceContract(serviceContract);
    }

    /**
     * 修改维保合同
     * 
     * @param serviceContract 维保合同
     * @return 结果
     */
    @Override
    public int updateServiceContract(ServiceContract serviceContract)
    {
        serviceContract.setUpdateTime(DateUtils.getNowDate());
        return serviceContractMapper.updateServiceContract(serviceContract);
    }

    /**
     * 批量删除维保合同
     * 
     * @param ids 需要删除的维保合同主键
     * @return 结果
     */
    @Override
    public int deleteServiceContractByIds(Long[] ids)
    {
        return serviceContractMapper.deleteServiceContractByIds(ids);
    }

    /**
     * 删除维保合同信息
     * 
     * @param id 维保合同主键
     * @return 结果
     */
    @Override
    public int deleteServiceContractById(Long id)
    {
        return serviceContractMapper.deleteServiceContractById(id);
    }


}
